var viewCafeOrder = new ViewCafeOrder();

$(document).ready( function() {
    loadTemplates(setupDefaultView);
});

function setupDefaultView() {
    var bodyView = viewCafeOrder.defaultView();

    //Setup the default view
    var defaultView = { 
        title : "Tables",
        view : bodyView,
    };

    //Setup the ViewNavigator
    window.viewNavigator = new ViewNavigator('body');
    window.viewNavigator.pushView(defaultView);    
    //$.getScript("data.js", scriptSuccess);
}

function onSelectTable(event) {    
    var tableView = { 
        title : "Menu",
        backLabel: (isTablet() ? "Back" : " "),
        view : viewCafeOrder.tableView(),
    };
    
    window.viewNavigator.pushView(tableView);    
}